package com.ram.testcoherence.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import org.eclipse.persistence.annotations.CacheInterceptor;
import oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor;

import org.eclipse.persistence.annotations.Property;

@Entity
//@Property(name="coherence.cache.name", value="Employee") // default * cache name in coherence-cache-config.xml file is entity name
//it can override using @property annotation property.
@CacheInterceptor(value = CoherenceInterceptor.class)  
@NamedQueries({
  @NamedQuery(name = "Person.findAll", query = "select o from Person o")
})
public class Person implements Serializable {
    @Column(length = 40)
    private String name;
    @Id
    @Column(nullable = false)
    private Long personid;
    private Long phone;

    public Person() {
    }

    public Person(String name, Long personid, Long phone) {
        this.name = name;
        this.personid = personid;
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getPersonid() {
        return personid;
    }

    public void setPersonid(Long personid) {
        this.personid = personid;
    }

    public Long getPhone() {
        return phone;
    }

    public void setPhone(Long phone) {
        this.phone = phone;
    }
}
